<template>
    <div class="bod">
        <div class="heade" v-if="userReward.rewardStatus==2">
           <div><i v-bind:style="{backgroundImage:'url('+require('../../../assets/bank/small_logo/'+bankCardBag.bankAbbreviation+'.png')+')'}"></i> <span>{{bankCardBag.bankName}}</span></div>
        </div>
        <div class="heade" v-else>
           <div> <i v-bind:style="{backgroundImage:'url('+require('../../../assets/personal/images/wx.png')+')'}"></i> <span>微信提现</span></div>
        </div>
        <div class="money">
            {{userReward.amount | amountMin100(2)}}
        </div>
        <div class="state" v-if="userReward.rstatus==0">
             审核中
        </div>
        <div class="state" v-else-if="userReward.rstatus==1">
             审核成功
        </div>
        <div class="state" v-if="userReward.rstatus==2">
            审核失败
        </div>
        <div class="Themainbody">
             <div>
                 <ul>
                     <li><span>提现说明</span><span>收益提现</span></li>
                     <li>
                         <img v-if="2==userReward.rstatus" src="../../../assets/personal/images/shenheshibai.png" class="img_positioning">
             <img v-else-if="0==userReward.rstatus" src="../../../assets/personal/images/shenhez.png" class="img_positioning">
             <img v-else src="../../../assets/personal/images/chengong.png" class="img_positioning">
                         <span>处理进度</span><span>提现申请</span><span> {{userReward.ctime | formatDateTIME}}</span>

                     </li>
                     <li><span>银行处理中</span><span>预计24小时到账</span></li>
                     <li><span :class="{grey:0==userReward.rstatus}">到账成功</span><span v-if="userReward.rstatus==0"></span><span v-else>{{userReward.mtime | formatDateTIME}}</span></li>
                     <li><span>提现到</span><span v-if="userReward.rewardStatus==2">{{bankCardBag.bankName}}({{bankCardBag.bankId | capitalize4}}){{bankCardBag.bankUserName}}</span ><span v-else>微信提现</span></li>
                     <li><span>创建时间</span><span v-if="userReward.rewardStatus==2">{{bankCardBag.ctime | formatDateTIME}}</span><span v-else>{{userReward.ctime | formatDateTIME}}</span></li>
                 </ul>
             </div>
             
        </div>
        <button class="sumb" @click="href">确定</button>
    </div>
</template>
<style scoped>
 @import "../../../assets/personal/css/withdrawalstate.css";
</style>
<script>
export default {
    data () {
        return {
            rewardId:this.$route.query.rewardId,
            bankCardBag:{},
            userProfit:{},
            userReward:{},
            rewardType:'',
            newcan:this.$route.query.newcan,
        }
    },
    mounted(){
        console.log(this.rewardId)
        console.log(this.newcan)
      this.list()
    },
    methods:{
     list(){
        this.$http.get(this.APIURL_PREFIX+"/api/wap/rewards/get",{params:{rewardId:this.$route.query.rewardId}}).then((response) => {
          this.bankCardBag=response.data.data.bankCardBag  //卡包
          this.userProfit=response.data.data.userProfit  //流水
          this.userReward=response.data.data.userReward  //提现
          this.rewardType=response.data.data.userReward.rewardType;
        }).catch(function(err){
            console.log(err)
        });
       },
       href:function(){
           if(this.newcan==1){
               this.$router.push({name:'me_money'})
           }else{
               if(0==this.rewardType){
            this.$router.push({ name:'cash_earnings'})
           }else{
            this.$router.push({ name:'busCash_eamings',query:{id:this.userProfit.companyId}})          
           }
           }
          
       }
    }
}
</script>
